/*
 * $Id: MapFrameMouseAdaptor.java 23 2009-03-31 23:37:36Z aaron.day $
 */
package org.crazydays.gameplan.map.swing.event;


import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;

import org.crazydays.gameplan.map.swing.JMapFrame;

/**
 * MapFrameMouseAdaptor
 */
public class MapFrameMouseAdaptor
        extends MouseAdapter
{
	/** map frame */
	protected JMapFrame mapFrame;

	/**
	 * MapFrameMouseAdaptor constructor.
	 * 
	 * @param mapFrame Map frame
	 */
	public MapFrameMouseAdaptor(JMapFrame mapFrame)
	{
		setMapFrame(mapFrame);
	}

	/**
	 * Set map frame.
	 * 
	 * @param mapFrame Map frame
	 */
	public void setMapFrame(JMapFrame mapFrame)
	{
		this.mapFrame = mapFrame;
	}

	/**
	 * Get map frame.
	 * 
	 * @return Map frame
	 */
	public JMapFrame getMapFrame()
	{
		return mapFrame;
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
	 */
	public void mouseClicked(MouseEvent e)
	{
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseDragged(java.awt.event.MouseEvent)
	 */
	public void mouseDragged(MouseEvent e)
	{
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseEntered(java.awt.event.MouseEvent)
	 */
	public void mouseEntered(MouseEvent e)
	{
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseExited(java.awt.event.MouseEvent)
	 */
	public void mouseExited(MouseEvent e)
	{
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseMoved(java.awt.event.MouseEvent)
	 */
	public void mouseMoved(MouseEvent e)
	{
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
	 */
	public void mousePressed(MouseEvent e)
	{
	}

	/**
	 * Show context menu on right mouse click.
	 * 
	 * @param e Event
	 * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
	 */
	public void mouseReleased(MouseEvent e)
	{
		// right button opens context menu
		if (e.getButton() == MouseEvent.BUTTON3) {
			getMapFrame().showContextMenu(e.getComponent(),
			        e.getX(), e.getY());
		}
	}

	/**
	 * @param e
	 * @see java.awt.event.MouseAdapter#mouseWheelMoved(java.awt.event.MouseWheelEvent)
	 */
	public void mouseWheelMoved(MouseWheelEvent e)
	{
	}
}
